package com.buer.storage.dao;

import com.buer.storage.dto.*;
import com.buer.storage.entity.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface WorderDao {

    //订单入库
    int insertOrder(PutStorageDto putStorageDto);

    //商品入库
    int insertDetails(@Param(value="arrary") Worderdetails[] putProds);

    //查询订单表
    List<WorderDto> findOrderAll();

    List<Worder> selectByAll(Map<String, Object> map);


    //根据订单id删除商品信息
    int deletePutStorageById(int putId);

    //根据商品表id删除商品信息
    int deleteWorderdetails(int detailsId);


    void deleteWorderByPutId(Integer putId);

    void deleteWorderDetailsByPutId(Integer putId);

    int updateAddSumStock(Stock stock);

    int updateResiduenum(StockDto stockdto);

    int updateImg(Stock stock);

    void insertStock(WorderdetailsDto putProd);

    Stock queryBuerStockByParam(WorderdetailsDto putProd);

    Prod queryStockCode(Stock stock);

    StockDto queryBuerStock(WorderdetailsDto putProd);

    //查询入库表
    List<PutStorageAllDto> findPutAll(Integer putId);

    WorderdetailsDto[] findOrderDetailInfoByPutId(Integer putId);

    WorderdetailsDto[] findWordertailsAll(Integer putId);

    int updateWorderStatus(Integer putId);

    int insertStockdetails(WorderdetailsDto putProd);

    Stockdetails findStockdetails();

    List<WorderDto> getWord(Map<String, Object> map);
    List<WorderdetailsDto> getWorderdetails(Map<String, Object> map);
    List<StockDto> getStock(Map<String, Object> map);

    Worder get(Integer putId);

    int update(Worder worder);

}
